﻿;; read
(def! READ read-string)


;; eval
(def! EVAL (fn* [ast]
  ast))

;; print
(def! PRINT pr-str)

;; repl
(def! rep (fn* [strng]
  (PRINT (EVAL (READ strng)))))

;; repl loop
(def! repl-loop (fn* [line]
  (if line
    (do
      (if (not (= "" line))
        (try*
          (println (rep line))
          (catch* exc
            (println "Uncaught exception:" exc))))
      (repl-loop (readline "lisp-user> "))))))

;; main
(repl-loop "")